package backend_0010;

public class PlainRect extends Rect{
    public double startX;
    public double startY;

    public PlainRect(double width,double height,double startX,double startY){
        super(width,height);
        this.startX=startX;
        this.startY=startY;
    }
    public PlainRect(){
        super(0,0);
    }
    public boolean isInside(double x, double y){
        if(startX<x&&x<(startX+width)&&(startY-height)<y&&y<startY){
            return true;
        }
        else {
            return false;
        }
    }

    public static void main(String[] args) {
        PlainRect test=new PlainRect(10,20,10,10);
        double area=test.area();
        double perimeter=test.perimeter();
        System.out.println("测试矩形的面积："+area);
        System.out.println("测试矩形的周长："+perimeter);
        boolean result=test.isInside(25.5,13);
        if(result==true){
            System.out.println("测试点在矩形内部");
        }
        else {
            System.out.println("测试点不在矩形内部");
        }

        System.out.println();
    }


}
